// import Djradio from "./Djradio"
// import Playlist from "./Playlist"
// import Toplist from "./Toplist"
import { Router, Link, NavLink, Switch, Redirect } from "react-router-dom"
import ComponentSub from "../../Routes/ComponentSub"
const Discover = props => {

  let {routes}=props
    return (
        <fieldset>
            <legend>发现音乐</legend>
            <ul>
                <li>
                    <Link to={`${props.match.path}/djradio`}>主播电台</Link>
                </li>
                <li>
                    <Link to={`${props.match.path}/playlist`}>歌单</Link>
                </li>
                <li>
                    <Link to={`${props.match.path}/toplist`}>排行榜</Link>
                </li>
            </ul>
            {/* <Route path="/discover/djradio" component={Djradio}></Route>
            <Route path="/discover/playlist" component={Playlist}></Route>
            <Route path="/discover/toplist" component={Toplist}></Route>
            <Redirect from={`${props.match.path}`} to={`${props.match.path}/playlist`}></Redirect> */}

        {
            routes.map((item,index)=>{
                return <ComponentSub {...item} key={index}/>
            })
        }
  


        </fieldset>

    )
}
export default Discover